package com.wuzuqing.android.eightdiagrams.task;

import com.wuzuqing.android.eightdiagrams.model.QiMenDunJiaItem;

import java.util.Arrays;
import java.util.List;

/**
 * @CopyRight: 广州仰望星空云科技有限公司
 * @Author : wuzuqing
 * @Email:wuzuqing@xinyu668.com
 * @CreateTime: 26.7.24 3:31 PM
 * @Description: 请写描述
 */
public abstract class IQiMenDunJiaTask {
    public abstract void handleTask();

    protected List<Integer> listArr = Arrays.asList(6, 1, 8, 3, 4, 9, 2, 7);
    protected List<Integer> yinListArr = Arrays.asList(6, 7, 2, 9, 4, 3, 8, 1);

    public QiMenDunJiaItem getDunJia(List<QiMenDunJiaItem> list, int gongNum) {
        for (QiMenDunJiaItem s : list) {
            if (s.getGongNum() == gongNum) {
                return s;
            }
        }
        return null;
    }


    public  String getDiPanGan(List<QiMenDunJiaItem> list, int gongNum) {
        QiMenDunJiaItem dunJia = getDunJia(list, gongNum);
        if (dunJia != null) {
            return dunJia.getDiPanGan();
        }
        return "";
    }

}
